version: '3.7'

networks:
  portainer-network:
    driver: bridge
    ipam:
      config:
        - subnet: ${PORTAINER_SUBNET}

services:
  portainer:
    container_name: portainer
    build:
      context: ./
      dockerfile: Dockerfile
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./${PORTAINER_DATA}:/data
    ports:
    - '9443:9443'
    networks:
      portainer-network:
        ipv4_address: ${PORTAINER_IP}
